package com.cskaoyan.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@Valid
@Data
public class Goods {
    private Integer id;

    @NotNull(message = "商品编号不能为空")
    private String goodsSn;

    @NotNull(message = "商品名称不能为空")
    private String name;

    private Integer categoryId;

    private Integer brandId;

    private String[] gallery;

    private String keywords;

    private String brief;

    private Boolean isOnSale;

    private Short sortOrder;

    private String picUrl;

    private String shareUrl;

    private Boolean isNew;

    private Boolean isHot;

    private String unit;

    @Valid
    @DecimalMin(value = "0", inclusive = false, message = "专柜价格必须大于0")
    private BigDecimal counterPrice;

    @Valid
    @DecimalMin(value = "0", inclusive = false, message = "当前价格必须大于0")
    private BigDecimal retailPrice;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date addTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private Boolean deleted;

    private String detail;
}